package handler

import (
	"astgram/common"
	"astgram/model"
	"astgram/service"
	"fmt"
	"github.com/gin-gonic/gin"
)

func GetImages(c *gin.Context) {
	req := &model.GetImagesRequest{}
	if err := c.BindQuery(req); err != nil {
		c.JSON(400, err.Error())
		return
	}
	fmt.Printf("%v\n", req)
	var ss service.GetImagesService
	resp, err := ss.Execute(c, req)
	if err != nil {
		common.WriteError(c, err)
		return
	}
	c.JSON(200, resp)
}
